Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile: Fixes #11028: Accessibility: Fix sidebar broken in right-to-left mode, improve screen reader accessibility #11056

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Sep 16, 2024

Summary

This pull request replaces the unmaintained react-native-side-menu-updated with a custom SideMenu with a similar implementation: Both use React Native's Aniamted and PanResponder.

This fixes several issues:

  • Missing accessibility label for the side menu close overlay.
  • Workarounds were needed to prevent side menu content from being accessibility focusable while sidemenus were closed.
  • Support for right-to-left languages.

Additionally, it fixes a recent iOS regression:

  • The screen reader can't focus individual items in the sidemenu.

It should also make the sidebar better at detecting fast open/close gestures.

Resolves #11028.
Resolves #8999.

Screen recordings

Web/Firefox

Screencast.from.2024-09-15.14-16-00.webm

Android 13

No TalkBack:

out.mp4

With TalkBack:

out.mp4

iOS 17 (simulator)

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-15.at.14.22.00.mp4

iOS (simulator, reduce motion)

after-pr-ios-ltr-portrait-reduce-motion.mp4

iOS (simulator, right-to-left layout)

Portrait:

after-pr-ios-rtl-portrait.mp4

Landscape:

after-pr-rtl-landscape.mp4

Observe that there are still issues in landscape mode on iOS devices with a notch — the sidemenu can be partially covered by the notch. This, however, seems better than before (see recordings under "Compare with before").

Compare with before
pre-pull-request--ios-rtl.mp4
before-pr-ios-rtl-portrait.mp4

iOS (simulator, VoiceOver enabled)

after-pr-ios-voiceover.mp4

@personalizedrefrigerator personalizedrefrigerator added mobile All mobile platforms accessibility Related to accessibility labels Sep 16, 2024
@@ -11,7 +11,6 @@ export const DEFAULT_ROUTE = {
const appDefaultState: AppState = {
smartFilterId: undefined,
...defaultState,
sideMenuOpenPercent: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sideMenuOpenPercent state was previously unused (only usage commented out).

Comment on lines -603 to +592
// Accessibility, keyboard, and touch hidden.
inert={isHidden}
refocusCounter={isHidden ? undefined : 1}
>
<View style={style}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "hide for accessibility" and autofocus logic is now handled by SideMenu.tsx, so this workaround is no longer necessary.

@laurent22 laurent22 merged commit e0daf80 into laurent22:dev Sep 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility mobile All mobile platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with the three lines that contain side options. Android UI is misaligned for RTL languages
2 participants